package com.yupi.springbootinit.service;

import com.yupi.springbootinit.model.dto.product.ProductRequest;
import com.yupi.springbootinit.model.vo.ProductVO;
import com.yupi.springbootinit.model.entity.Product;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yupi.springbootinit.model.vo.UserVO;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 *
 */
public interface ProductService extends IService<Product> {

    /**
     * 获取所有未售的商品
     * @return
     */
    List<ProductVO> listAllProduct(ProductRequest productRequest);

    /**
     * 创建商品
     * @param product
     * @param loginUser
     * @return
     */
    Long createProduct(Product product, UserVO loginUser);

    /**
     * 更新商品信息
     *
     * @param productVO
     * @param request
     * @return
     */
    boolean updateProduct(ProductVO productVO, HttpServletRequest request);

    /**
     * 展示我创建的商品
     * @param loginUser
     * @return
     */
    List<ProductVO> showMyProduct(UserVO loginUser);
}
